package ModelLayer;


/**
 * Write a description of class Loan here.
 * 
 * @author (Allan Lie) 
 * @version (V1)
 */
public class Loan
{
    // instance variables - replace the example below with your own
    private Dvd dvd;
    private DvdCopy dvdCopy;
    private Person person;
    private int id;
    private String date;
    private int period;
 
    
    public Loan(int id, String date, int period)
    {
        this.id = id;
        this.date = date;
        this.period = period;
    }
    
    public Loan()
    {
        date = "";
    }

    //set Id
    public void setId(int id)
    {
        this.id = id;
    }
    //set Date
    public void setDate(String date)
    {
        this.date = date;
    }
    //set Period
    public void setPeriod(int period)
    {
        this.period = period;
    }

    
    //add Person
    public void addPerson(int id, String name, String address, int zipCode, String city, String phone)
    {
        person = new Person(id, name, address, zipCode, city, phone);
    }
    
    //add Dvd
    public void addDvd(int id, String title, String artist, String releaseDate)
    {
        dvd = new Dvd(id, title, artist, releaseDate);    
    }
    
    //add dvdCopy
    public void addDvdCopy(String serial, String reqDate, double buyPrice)
    {
        dvdCopy = new DvdCopy(serial, reqDate, buyPrice);
    }
    
    //setPerson
    public void setPerson(Person p)
    {
        person = p;
    }
    
    //setDvd
    public void setDvd(Dvd d)
    {
        dvd = d;
    }
    //setDvdCopy
    public void setDvdCopy(DvdCopy dc)
    {
        dvdCopy = dc;
    }
    
    //get Id
    public int getId()
    {
        return id;
    }
    //get Date
    public String getDate()
    {
        return date;
    }
    //get Period
    public int getPeriod()
    {
        return period;
    }

    //get Dvd
    public Dvd getDvd()
    {
        return dvd;   
    }
    //get DvdCopy
    public DvdCopy getDvdCopy()
    {
        return dvdCopy;
    }
    //get Person
    public Person getPerson()
    {
        return person;
    }
}
